package com.example.demo.configuration;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @description:
 * @author: cj
 * @create: 14-01-10 14:16:51
 */
@Configuration
public class OssConfig {
    @Value("${alias.accessKeyID}")
    String accessKeyID;
    @Value("${alias.accessKeySecret}")
    String accessKeySecret;
    @Value("${alias.endpoint}")
    String endpoint;

    @Bean
    public OSS ossClient() {
        return new OSSClientBuilder().build( "https://" + endpoint, accessKeyID, accessKeySecret );
    }
}
